<!DOCTYPE html>
<html lang="en" class="no-js"  xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>跨境贸易电子商务服务平台金二申报系统</title>


    <link type="text/css" rel="stylesheet" th:href="@{/css/TweenLite/normalize.css}"></link>
    <link type="text/css" rel="stylesheet" th:href="@{/css/TweenLite/demo.css}"></link>
    <link type="text/css" rel="stylesheet" th:href="@{/css/TweenLite/component.css}"></link>

</head>
<body>
<div class="container demo-1">
    <div class="content">
        <div id="large-header" class="large-header">
            <canvas id="demo-canvas"></canvas>
            <div class="logo_box">
                <form method="post" id="form" action="login">
                    <div class="input_outer">
                        <span class="u_user"></span>
                        <input name="id" id="userId" class="text" style="color: #FFFFFF !important" type="text" placeholder="请输入账户">
                    </div>
                    <div class="input_outer">
                        <span class="us_uer"></span>
                        <input name="password" id="password" class="text" style="color: #FFFFFF !important; position: absolute; z-index: 100;" value="" type="password" placeholder="请输入密码">
                    </div>

                    <div class="mb2">
                        <a class="act-but submit" href="javascript:void(0);"  onclick="doSubmit();" style="color: #FFFFFF">登录</a>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript" th:src="@{/js/TweenLite/TweenLite.min.js}"></script>
<script type="text/javascript" th:src="@{/js/TweenLite/EasePack.min.js}"></script>
<script type="text/javascript" th:src="@{/js/TweenLite/rAF.js}"></script>
<script type="text/javascript" th:src="@{/js/TweenLite/demo-1.js}"></script>
<script type="text/javascript" th:src="@{/js/jQuery-2.1.4.min.js}"></script>
<script type="text/javascript" th:src="@{/js/layer/layer.js}"></script>
<script type="text/javascript" th:src="@{/js/login.js}"></script>
<script>
    let base = [[@{/}]];
    document.onkeydown = function(event){
        let e = event || window.event || arguments.callee.caller.arguments[0];
        if (e && e.keyCode==13) {
            doSubmit();
        }
    }
    function doSubmit() {
        let form=$('#form');
        console.log(form.serialize());
        $.ajax({
            url:"login",
            method: "post",
            data: form.serialize(),
            success:function(result){
                if(result.status==1){
                    window.location.href = base;
                }else{
                    layer.alert(result.message, {
                        icon: 5,
                        title: "登录失败"
                    });
                }
            }
        })
    }
</script>
</body>
</html>